package cn.hzu.sotacy.controller.user;


import cn.hzu.sotacy.model.user.UserLearningCourse;
import cn.hzu.sotacy.response.ApiRestResponse;
import cn.hzu.sotacy.service.user.UserLearningCourseService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 作者
 * @since 2021-12-23
 */
@RestController
@RequestMapping("/userLearningCourse")
public class UserLearningCourseController {

    @Resource
    UserLearningCourseService userLearningCourseService;

    @ResponseBody
    @PostMapping("/add")
    ApiRestResponse<UserLearningCourse> addUserLearningCourse(HttpServletRequest request, HttpServletResponse response) {
        return userLearningCourseService.addUserLearningCourse(request, response);
    }

    @ResponseBody
    @PostMapping("/get")
    ApiRestResponse<List<UserLearningCourse>> getUserLearningCourse(HttpServletRequest request, HttpServletResponse response) {
        return userLearningCourseService.getUserLearningCourse(request, response);
    }
}
